package ckw.election;

import java.util.UUID;

import ckw.database.model.AdministratorToken;
import ckw.database.model.Election;
import ckw.database.model.ElectionNode;
import ckw.database.model.ElectionNonResidentVoter;
import ckw.database.model.ElectionResidentVoter;
import ckw.database.model.Member;
import ckw.database.model.Voter;
import core.communication.message.VotersPackageMessage;
import core.communication.message.VotesPackageMessage;
import core.exceptions.ObjectDeleteException;
import core.exceptions.WrongActionException;

public interface ElectionService {

	/* Election */

	public Election saveElection(Election election);

	public Election updateElection(Election election) throws WrongActionException;

	public void deleteElection(Election election) throws ObjectDeleteException;
	
	public void handleVotesPackage(VotesPackageMessage message);

	public void handleVotersPackage(VotersPackageMessage message);
	
	public void initElectionResults(Election election);

	/* Member */

	public void addMember(ElectionNode electionNode, Member member);

	public void removeMember(ElectionNode electionNode, Member member);

	public UUID generateToken(AdministratorToken token);

	/* ResidentVoter */

	public void addResidentVoter(Election election, Voter voter);

	public void removeResidentVoter(ElectionResidentVoter electionResidentVoter);

	/* NonResidentVoter */

	public void addNonResidentVoter(Election election, Voter voter);

	public void removeNonResidentVoter(ElectionNonResidentVoter electionNonResidentVoter);

	public void addNonresidentVoterToElectionResults(Long electionIdentificationField);

}
